This paper addresses the problem of management and coordination of energy resources in a typical microgrid, including smart buildings as flexible loads, energy storages and renewables. The overall goal is to provide a comprehensive and innovative framework to maximize the overall benefit, still accounting for possible requests to change the load profile coming from the grid and leaving every single building or user to balance between servicing those requests and satisfying his own comfort levels. The user involvement in the decision-making process is granted by a management and control solution exploiting an innovative distributed model predictive control approach with coordination. In addition, also a hierarchical structure is proposed, to integrate the distributed MPC user-side with the microgrid control, also implemented with an MPC technique. The proposed overall approach has been implemented and tested in several experiments in the laboratory facility for distributed energy systems (Smart RUE) at NTUA, Athens, Greece. Simulation analysis and results complement the testing, showing the accuracy and the potential of the method, also in the perspective of implementation.