Asymptotic giant branch (AGB) stars are among the most important gas and dust polluters of the Universe. The latest AGB evolutionary models take into account dust production in the circumstellar envelope of these stars, starting from a detailed computation of the main physical processes and chemical surface variations occurring in this evolutionary phase. Following the formation and growth of dust particles, they provide the unique possibility of interpreting the AGB population observed in resolved galaxies. The first application was for the Spitzer observations of dusty AGBs in the Magellanic Clouds, characterising carbon-rich and oxygen-rich stars in terms of initial mass, epoch of star formation, evolutionary time on the AGB and dust contribution. The same set of models are able to interpret the CNO surface abundances observed for the PNe of the same galaxies.