Asymptotic giant branch (AGB) stars are red giants characterised by a degenerate carbon-oxygen core. AGB stars with photospheric C/O ratio < 1 are called oxygen stars, those with photospheric ratio C/O > 1 are called carbons stars. AGB stars are also characterised by phenomena of mass loss, with typical rates of 10^{-8} up to 10^{-4} solar masses per year. Dust ejected in the winds forms a circumstellar environment which in many cases obscures the central star in the optical, and creates a bright infrared (IR) source. The spectral energy distribution (SED) of a dust obscured object may entirely be dominated by the thermal re-emission of the dust grains, but the spectral region which reveals the nature of the circumstellar dust is that around 10-20 um. The chemical composition of the dust shell usually reflects that of the stellar photosphere, hence, carbon-rich dust grains are thought to be the major components of the envelopes of carbon stars, while oxygen-rich stars are thought to be surrounded by dust shells mainly formed of O-rich grains. Here we investigate in detail the diagnostic content of the spectral analysis, and develop an algorithm for finding the best-fit to the observational data, based on a full radiative transport treatment. We observed a selection of carbon and oxygen-rich stars, taking broadband photometry in the optical, near-IR and sub-millimetre, and low-resolution spectra in the mid-IR. We found that in the circumstellar environments of O-rich stars, silicate grains with olivine stoichiometry are more likely to be present than pyroxene glasses, which, instead, might be responsible for some of the unknown features observed in the mid-IR spectra of carbon stars. We also addressed the problem of the far-IR flux excess observed in many carbon stars. If it is correct to ascribe it to previous episodes of higher (than the current) mass loss rate, then the derived time scale for the mass loss rate modulation is of a 10^3 years.