Individuals in communities in which different strains of pathogen are circulating can acquire resistance by accumulating immunity to each strain. After considering susceptibility, models of infection and immunity are defined for vector-borne diseases such as malaria and trypanosomiasis. For these models the prevalence of infection, the number of infections per individual, and the mean duration of infection, increase rapidly in young individuals, but decrease in older individuals as immunity is acquired to the various strains of pathogen; the mean interval between successive infections lengthens with age. The bivariate Poisson distribution is shown to be a close approximation to some stochastic processes. The models explain observed cross-sectional patterns of age prevalence, and longitudinal patterns in which individuals typically continue to become infected as they age, albeit with decreasing frequency. In these models the time spent infected depends on parasite diversity, as well as the inoculation and recovery rates. It is shown that control measures can cause an increase in the number of infections and the prevalence of infection in older individuals, and in the average prevalence in the community, even when strain-specific immunity is life-long.