In recent decades, many EU and national regulations have been issued in order to increase the energy efficiency in different sectors and, consequently, to reduce environmental pollution. In the building sector, energy efficiency interventions are usually based on the use of innovative insulated materials and on the installation of cogeneration and tri-generation units, as well as solar technologies. New and retrofitted buildings are more and more commonly being called “smart buildings”, since they are characterized by the installation of electric and thermal power generation units, energy storage systems, and flexible loads; the presence of such technologies determines the necessity of installing Building Energy Management Systems (BEMSs), which are used to optimally manage their operation. The present paper proposes a BEMS for a smart building, equipped with plants based on renewables (photovoltaics, solar thermal panels, and geothermal heat pump), where the heating and cooling demand are satisfied by a Heating, Ventilation and Air Conditioning System (HVAC) fed by a geothermal heat pump. The developed BEMS is composed of two different modules: an optimization tool used to optimally manage the HVAC plant, in order to guarantee a desired level of comfort inside rooms, and a simulation tool, based on an equivalent electric circuit model and used to evaluate the thermal dynamic behavior of the building. The paper describes the two modules and shows the main results of the validation phase that has been conducted on a real test-case represented by the Smart Energy Building (SEB) located at the Savona Campus of the University of Genoa, Italy.