Alternatively, you may use expansion of cotangent $$ \pi\cot \pi x=\frac1x+\sum_{n=1}^{\infty}\frac{2x}{x^2-n^2} $$ as a blackbox (after all, complex residues are not the only way to obtain this formula: say, there is Herglotz trick, explained, for instance, in Proofs from the Book). Just substitute $x=i$, for the sum $S=\sum_{n=0}^{\infty} \frac1{n^2+1}$ we get $\pi \cot \pi i=-i-2i(S-1)$, $2iS=i-\pi \cot \pi i=i(1+\pi\coth \pi)$, $S=(1+\pi \coth \pi)/2$. For arbitrary rational function $f(z)$, we may find on this way the principal value of $\sum_{n\in \mathbb{Z}} f(n)$. If $f(z)=\sum_k c_k/(z_k-z)$, for each summand we have $$ \sum_{j=-n}^n\frac1{z_k-j}=\frac1{z_k}+\sum_{k=1}^n\frac{2z_k}{z_k^2-j^2}\rightarrow \frac{\pi\cot \pi z_k}2, $$ thus principal value of $\sum_{n\in \mathbb{Z}} f(n)$ equals $$ \sum_k c_k \frac{\pi\cot \pi z_k}2. $$ This works whenever $f$ has only simple poles and $f(z)=O(1/z)$ for large $z$. If additionally $f(z)=O(1/z^2)$, principal value is the same as ordinary sum. If $f$ has multiple poles, we may perturbate $f$ a bit and take a limit. Yes, this is one of approaches to residues. If you need a sum not over integers, but over positive integers (it looks like it is the case), you instead of cotangent use the digamma $\psi$-function $$ \psi(z)=-\gamma+\sum_{n=0}^{\infty} \left(\frac1{n+1}-\frac1{n+z}\right). $$ This is the essence of Gerald Edgard's answer.