Local optical spectroscopy in quantum confined systems: a theoretical description