Bridge between complex analysis and differential geometry

I am not a mathematician but I have noticed how strangley similar the treatments of curvature and residues are when you compare the residues of residue calculus and the curviture of the gauss bonet forumlation of surfaces. Is there some generalization of things that contains both of these formulations as a subset?