Many disease pathogens stimulate immunity in their hosts, which then wanes over time. To better understand the impact of this immunity on epidemiological dynamics, we propose an epidemic model structured according to immunity level that can be applied in many different settings. Under biologically realistic hypotheses, we find that immunity alone never creates a backward bifurcation of the disease-free steady state. This does not rule out the possibility of multiple stable equilibria, but we provide two sufficient conditions for the uniqueness of the endemic equilibrium, and show that these conditions ensure uniqueness in several common special cases. Our results indicate that the within-host dynamics of immunity can, in principle, have important consequences for population-level dynamics, but also suggest that this would require strong non-monotone effects in the immune response to infection. Neutralizing antibody titer data for measles are used to demonstrate the biological application of our theory.