Use the residue theorem! You will have two cases
Case 1:
if $\displaystyle p(b)=0$ then the residue at $\displaystyle b$ is given by
$\displaystyle \displaystyle \text{Res}(f,z=b)=\lim_{z \to b}(z-b)\frac{p(z)}{z-b}=0$
if $\displaystyle p(b)=a$ then the residue at $\displaystyle b$ is given by
$\displaystyle \displaystyle \text{Res}(f,z=b)=\lim_{z \to b}(z-b)\frac{p(z)}{z-b}=p(b)$
so by the residue theorem $\displaystyle \displaystyle \int_c \frac{p(z)}{z-b}dz=2\pi i \text{Res}(f,z=b)=2 \pi i p(b)$