Complex analysis is often used in analytic number theory as a tool to evaluate or estimate sums $\sum a_n $ by studying the analytic behaviour (like existence of poles or how fast it grows) of the associated Dirichlet series $\sum a_n n^{-s}$. So for most interesting arithmetical functions (like a_n = number of divisors of n, say), one can study the corresponding Dirichlet series (possibly factor it as a product of various $L$-functions) to obtain information about the sum. One uses the Perron formula or Mellin inversion formula to pass from the sum to a contour integral. Davenport's book is the canonical reference.