Applications of residues to combinatorial identities