We provide a self-consistent electromagnetic theory of the coupling between dipole emitters and dissipative nanoresonators. The theory that relies on the concept of quasinormal modes with complex frequencies provides an accurate closed-form expression for the electromagnetic local density of states of any photonic or plasmonic resonator with strong radiation leakage, absorption, and material dispersion. It represents a powerful tool to calculate and conceptualize the electromagnetic response of systems that are governed by a small number of resonance modes. We use the formalism to revisit Purcell's factor. The new formula substantially differs from the usual one; in particular, it predicts that a spectral detuning between the emitter and the resonance does not necessarily result in a Lorentzian response in the presence of dissipation. Comparisons with fully vectorial numerical calculations for plasmonic nanoresonators made of gold nanorods evidence the high accuracy of the predictions achieved by our semianalytical treatment.