We consider a class of systems where N identical particles with positions q1,⋯,qN and momenta p1,⋯,pN are enclosed in a box of size L and exhibit the scaling U(Lr1,⋯,LrN)=α(L)U(r1,⋯,rN) for the associated potential energy function U(q1,⋯,qN). For these systems, we propose an efficient implementation of the Wang-Landau algorithm for evaluating thermodynamic observables involving energy and volume fluctuations in the microcanonical description and temperature and volume fluctuations in the canonical description. This requires performing the Wang-Landau simulation in a scaled box of unit size and evaluating the density of states corresponding to the potential energy part only. To demonstrate the efficacy of our approach as example systems, we consider Padmanabhan's binary star model and an ideal gas trapped in a harmonic potential within the box. © 2018 American Physical Society.