Demand Response (DR) program is one of the ancillary services to reduce the peak load contribution of buildings by altering the operation of dispatchable load including Heating, Cooling and Air-Conditioning (HVAC) load. In this paper, a Model Predictive Controller (MPC) is designed to optimize the power flows from the grid and Energy Storage Systems (ESS) to a commercial building equipped with HVAC systems and PV panels. The MPC framework uses the inherent thermal storage of the building and the ESS as a means to provide DR. Our results show that the proposed control framework for Building-to-Grid (B2G) systems can significantly reduce the maximum load ramp-rate of the electric grid to prevent duck-curve issues associated with increase in solar PV penetration into the grid. The B2G simulation testbed in this paper is based on the experimental data obtained from an office building, PV panels, and battery packs at Michigan Technological University integrated with a 3-phase distribution test feeder. Compared to the rule-based controller, the proposed predictive control approach can decrease the building operation electricity cost by 28% while decreasing maximum load ramp-rates by more than 70%.