  We study the response of a class of topological systems to electromagnetic
and gravitational sources, including torsion and curvature. By using the
technology of anomaly polynomials, we derive the parity-odd response of a
massive Dirac fermion in $d=2+1$ and $d=4+1$, which provides a simple model for
a topological insulator. We discuss the covariant anomalies of the
corresponding edge states, from a Callan-Harvey anomaly-inflow, as well as a
Hamiltonian spectral flow point of view. We also discuss the applicability of
our results to other systems such as Weyl semi-metals. Finally, using
dimensional reduction from $d=4+1$, we derive the effective action for a
$d=3+1$ time-reversal invariant topological insulator in the presence of
torsion and curvature, and discuss its various physical consequences.
