This paper explores the load shaping ability of microgrid power systems coupled with flexible operation of HVAC systems for commercial customers. In the proposed framework, this integrated system is treated as a dispatchable power source/sink in order to mitigate the uncertainty and variability imposed on the external utility company. The load shaping required is enabled by the natural flexibility in space heating and cooling, along with dispatchable microgrid resources such as batteries. A hierarchical control approach is formulated for the scheduling and supervisory control of the flexible loads and dispatchable energy units within the microgrid. Stochastic optimization is used for scheduling at the slow time scale to ensure forecasting errors in renewable availability and energy demands can be rejected. Deterministic optimization is used at the fast time scale to update dispatch decisions in response to realized conditions. A case study demonstrates that this proposed control approach is able to substantially reduce the uncertainty and variability in energy exchange with the external utility across a variety of commercial load types and in different seasons.