The combination of demand response as demand side management together with energy management system has become essential to minimize energy cost, to maintain continuous supply of electricity, and to improve the safety of power system operation. This paper studies the optimal energy dispatch of connected microgrid units containing photovoltaic panels, wind turbine generators, diesel generators, and the main grid. The optimal set point of microgrid’s units is determined to satisfy the required load demand for a day-ahead horizon time. As the demand response is an important way of demand side management, this paper proposes as the main contribution the implementation of demand response cost as one of the objective functions to be maximized to view its effect on load demand consumption, on MG energy production and on MG energy cost. The demand response is implemented by using an incentive based demand response program in the optimization model in addition to the fuel cost of diesel generators and the transfer cost of transferable power. The incentive payment offered by utilities is used to motivate consumers to change their energy consumption behavior and thus to reduce their power consumption and maintain the system reliability during on-peak periods. Thus the objective function is formulated to maximize microgrid operator’s demand response benefit, and to minimize both the fuel cost of diesel generators, and the transfer cost of transferable power. For this purpose, the defined objective function is solved by a Hybrid Particle Swarm Optimization with Sine Cosine Acceleration Coefficients (H-PSO-SCAC) algorithm for an optimal energy management system of the connected microgrid. For the simulation tests, different algorithms are examined in order to validate the effectiveness of the H-PSO-SCAC algorithm. The impact of demand response program is analyzed on the load demand consumption, on the microgrid energy production and its influence on the optimized microgrid cost function. The results demonstrate that the implementation of demand response has changed the previous situation that costumers do not participate in the operation of the power system. And it enables microgrid to decrease load consumption, microgrid energy production, as well as energy cost.