Hybrid materials consisting of SiO2/CdS particles dispersed in poly(styrene-co-maleic anhydride) and poly(styrene-co-maleimide) have been synthesized and characterized. The polymer nanocomposites were synthesised in situ in the presence of previously prepared inorganic fillers (SiO2/CdS). The nanocomposites were synthesized with the use of as-prepared or surface-modified SiO2/CdS fillers. For both types of nanocomposites, the optical properties were evaluated and the observation of size quantization effects in the optical spectra is discussed. In this context, the influence of the inorganic fillers and polymer matrices on the optical properties of the final nanocomposites was investigated.