Invariant measures for dissipative dynamical systems: Abstract results and applications