How to use Stokes theorem in the presence of holes?

The usual way to arrive at this is by removing an $\varepsilon$-disk centered at the origin and taking the limit, but let me give a sketch of how you might do this with the Dirac delta function approach. I'm going to treat $\delta_0$ as the distribution with the property that for any smooth $f\colon\Bbb R^2\to\Bbb R$ with compact support, we have $$\delta_0(f) = \int_{\Bbb R^2}\delta_0(x,y) f(x,y)\,dx\wedge dy = 2\pi f(0).$$

You start with $\omega = \dfrac{-y\,dx+x\,dy}{x^2+y^2} = d\theta$ and we want to see that $d\omega = \delta_0 \,dx\wedge dy$ as a current. In particular, this means we want to see that for any smooth $f$ with compact support, we have $$\int_{\Bbb R^2} f\,d\omega = 2\pi f(0).$$ As usual, we start with the equation [think "integration by parts"] $$d(f\omega) = f\,d\omega + df\wedge\omega$$ and integrate over a large closed ball $B(0,R)$ with the property that $f=0$ on $\partial B(0,R)$. It will be convenient to use polar coordinates, of course, and then we see that $df\wedge\omega = \left(\dfrac{\partial f}{\partial r}dr + \dfrac{\partial f}{\partial\theta}d\theta\right)\wedge d\theta = \dfrac{\partial f}{\partial r}dr\wedge d\theta$. So \begin{align*} \int_{\Bbb R^2} f\,d\omega &= \int_{\Bbb R^2} d(f\omega) - \int_{\Bbb R^2} df\wedge\omega \\ &= \int_{B(0,R)} d(f\omega) - \int_{B(0,R)} df\wedge\omega \\ &= \int_{\partial B(0,R)} f\omega - \int_0^{2\pi}\int_0^R \dfrac{\partial f}{\partial r}dr\,d\theta \\ &= 0 - \int_0^{2\pi} \big(f(R,\theta)-f(0,\theta)\big)d\theta = 2\pi f(0), \end{align*} as needed.


Since you asked me to post my comment as an answer, I might as well expand on it a bit. I assume that you know about distributions and differential forms. You might also need to read up on the Hodge dual $\star$.

What you need is in essence an extension of distributions to differential forms. Those are commonly known under the name "currents" (the name is hard to google). They were first developed by Georges De Rham in the middle of the last century.

The idea is similar to distributions. You consider the space of smooth, compactly supported differential $k$-forms $\mathcal{D}^k$ as test functions and then take its topological dual $$\mathcal{D}_k = (\mathcal{D}^k)':= \{T: \mathcal{D}^k \to \mathbb{R}| T \text{ linear, continuous\}}$$ as the so called space of $k$-currents.

Then similar to how you can treat functions as distributions, you can treat an ordinary differential $k$-form $\alpha$ as a current $T_\alpha$ using $$T_\alpha: \omega \mapsto \int_{\mathbb{R}^n} \langle \alpha,\omega\rangle dx. $$ Here $\langle.,.\rangle$ is just the scalar product of $k$-forms (derived from the Hodge star). However you can define more than just functions, for example you might define a $2$-current in $\mathbb{R}^2$ using $$\tilde{T}: \omega \mapsto f(0,0), \text{ where } \omega = f dx\wedge dy$$ With some slight abuse of notation you then might write $\tilde T = \delta(x,y) dx \wedge dy$.

Now using the Hodge star, the exterior derivative $d$ has a dual operator $d^\star := (-1)^{n(l+1)+1}\star d \star$ (sometimes written as $\delta$, but this is easily confused with the Dirac-$\delta$), which maps $l$ to $l-1$-forms, in such a way that for any $k$-form $\alpha$ and any $k+1$-form $\beta$ we have $$\int_{\mathbb{R}^n} \langle d\alpha,\beta \rangle dx = \int_{\mathbb{R}^n} \langle \alpha,d^\star \beta \rangle dx.$$ We can then use duality to define the exterior derivative of a $k$-current $T$ as the $k+1$-current $$dT: \omega \mapsto T(d^\star \omega)$$ in the same way one defines derivatives of distributions. Then $$dT_\alpha(\omega) = T_\alpha(d^\star \omega)=\int_{\mathbb{R}^n} \langle \alpha,d^\star \omega \rangle dx = \int_{\mathbb{R}^n} \langle d\alpha,\omega \rangle dx = T_{d\alpha}(\omega)$$ so the notation is consistent.

However, if you take $\alpha:=\frac{1}{x^2+y^2}(-ydx+xdy)$, like in your example, then you can easily calculate (see also Ted Shifrin's answer for that) that with $\tilde{T}$ as before $$d T_\alpha = 2\pi \tilde{T}.$$

If you want to know a bit more about the theory behind this, I think de Rham's "Differentiable Manifolds: Forms, Currents, Harmonic Forms" is probably still the best source.

Sadly I do not know any book geared more towards applications. There are more modern treatments of currents, such as Frank Morgan's very well illustrated "Geometric measure theory". However the modern focus of currents is less to look at them as generalized functions and more as a generalization of integration.* So this will probably be a bit less helpful for your specific problem.

*For example any chain can be treated as a linear operator on differential forms and thus as a current. As currents have a dual topology inherited from the differential forms, you can then use this to study things such as convergence of those chains. And you can define things like the boundary operator for currents using $\partial T:\omega \mapsto T(d\omega)$, which is consistent with chains thanks to Stokes' theorem. But this is a completely different topic to your question.