  For BPS black holes with at least four unbroken supercharges, we describe how
the macroscopic entropy can be used to compute an appropriate index, which can
be then compared with the same index computed in the microscopic description.
We obtain exact results incorporating all higher order quantum corrections in
the limit when only one of the charges, representing momentum along an internal
direction, approaches infinity keeping all other charges fixed at arbitrary
finite values. In this limit, we find that the microscopic index is controlled
by certain anomaly coefficients whereas the macroscopic index is controlled by
the coefficients of certain Chern-Simons terms in the effective action. The
equality between the macroscopic and the microscopic index then follows as a
consequence of anomaly inflow. In contrast, the absolute degeneracy does not
have any such simple expression in terms of the anomaly coefficients or
coefficients of Chern-Simons terms. We apply our analysis to several examples
of spinning black holes in five dimensions and non-spinning black holes in four
dimensions to compute the index exactly in the limit when only one of the
charges becomes large, and find perfect agreement with the result of exact
microscopic counting. Our analysis resolves a puzzle involving M5-branes
wrapped on a 5-cycle in K3 x T^3.
