In this work we present a simple and elegant approach to study the adiabatic and nonadiabatic evolution of a generalized damped harmonic oscillator which is described by the generalized Caldirola–Kanai Hamiltonian, in both classical and quantum contexts. Based on time-dependent dynamical invariants, we find that the geometric phase acquired when the damped oscillator evolves adiabatically in time provides a direct connection between the classical Hannay’s angle and the quantum Berry’s phase. In addition, we solve the time-dependent Schrödinger equation for this system and calculate various quantum properties of the damped generalized harmonic one, such as coherent states, expectation values of the position and momentum operators, their quantum fluctuations and the associated uncertainty product.