Large deployment of Electric Vehicles (EVs) adds new challenges in the operation of a microgrid. Assuming that a number of EV owners allow their batteries to charge when their cars are parked, this paper proposes an approach that aims to find suitable individual active power set-points corresponding to the hourly charging rate of each EV battery connected to the microgrid. A multi agent system based controller is designed to find these active power set points for optimal power management of EVs, distributed energy resources in the microgrid, and the loads.