Take a look at this tutorial http://www.mathhelpforum.com/math-help/calculus/25215-contour-integration.html

Theorem 22 there can make the residue computation easier. It also has the same problem you're working on. This tutorial helps me a lot. It will help you too.