This document describes a flexible software-based distributed energy management system (DEMS) designed to investigate how controllable distributed energy units (CDEs) can be aggregated and integrated into the electric grid. The DEMS uses a hierarchical agent-based model to control different CDEs, including a wind turbine, combined heat and power plant, electric vehicle charging station, and industrial load. An experiment was conducted using the DEMS to demonstrate how it can aggregate these CDEs in different communication configurations to meet a secondary frequency control signal while maximizing profit from energy generation. Results showed the DEMS was able to successfully control the CDEs to closely track the required active power output.