Optical Dynamics in Low-Dimensional Semiconductor Heterostructures. Quantum Dots and Quantum Cascade Lasers