Dynamics and Thermodynamics in Hierarchically Organized Systems: Applications in Physics, Biology and Economics