Index Theorems for Holomorphic Maps and Foliations