In this paper, a comprehensive real-time interactive energy management system (EMS) framework for the utility and multiple electrically coupled MGs is proposed. A hierarchical bi-level control scheme (BLCS) with primary and secondary level controllers is applied in this regard. The proposed hierarchical architecture consists of sub-components of load demand prediction, renewable generation resource integration, electrical power-load balancing, and responsive load demand. In the primary level, EMSs are operating separately for each microgrid (MG) by considering the problem constraints, power set-points of generation resources, and possible shortage or surplus of power generation in the MGs. In the proposed framework, minimum information exchange is required among MGs and the distribution system operator. It is a highly desirable feature in future distributed EMS. Various parameters such as load demand and renewable power generation are treated as uncertainties in the proposed structure. In order to handle the uncertainties, Taguchi's orthogonal array testing approach is utilized. Then, the shortage or surplus of the MGs power should be submitted to a central EMS in the secondary level. In order to validate the proposed control structure, a test system is simulated and optimized based on multiperiod imperialist competition algorithm. The obtained results clearly show that the proposed BLCS is effective in achieving optimal dispatch of generation resources in systems with multiple MGs.