Quantum metrology and open quantum systems: theory and applications