The objective of this study is to demonstrate the effectiveness of model predictive control (MPC) in reducing the energy and demand costs for buildings in an electricity grid with time-of-use pricing and demand charges. A virtual model for a single floor, multi-zone commercial building equipped with a variable air volume (VAV) cooling system is built by Energyplus. Real-time data exchange between Energyplus and Matlab controller is realized by introducing the building controls virtual test bed (BCVTB) as a middleware. System identification technique is implemented to obtain the zone temperature and power model, which are to be used in the MPC framework. MPC with an economic objective function is formulated as a linear programming problem and solved. Pre-cooling effect during off-peak period and autonomous cooling discharging from the building thermal mass during on-peak period can be observed in a continuous weekly simulation. Cost savings brought by MPC are given by comparing with the baseline and other pre-programmed control strategies.