Combined heat and power (CHP) generation is a fundamental practice to reduce primary energy consumptions and mitigate the related greenhouse gas emissions. Cogeneration plants are even more important in the Hospital sector, as they give the opportunity to operate regardless of the electric power grid, so ensuring energy availability also during grid faults while providing significant cost savings to the public healthcare system. The integration of a battery energy storage with the CHP system could further increase the expected advantages by enabling more flexible operating strategies, further energy reliability and lower operating costs. Therefore, this research paper addresses the development of a specific methodology for the energetic and economic assessment of a grid connected CHP plant assisted by a battery energy storage. More specifically, an evaluation algorithm has been developed and then coupled to a genetic evolutionary algorithm. Then, a vector optimization problem has been solved to find the optimal configurations of a modular cogeneration plant (i.e. size and number of CHP gas engines; battery size) which maximize the primary energy saving while minimizing the payback period. Results based on electricity and heat demand of a hospital facility demonstrate how the battery energy storage system allows the shifting of the Pareto frontier towards better economic results if compared with Pareto solutions found when the optimization problem does not consider a battery storage supporting the CHP plant. The proposed methodology provides an effective and flexible procedure for the optimal configuration and detailed analysis of CHP plants integrated by an electrochemical based energy storage system. In fact, the effects of a high number of interacting energetic and economic parameters are considered together with the technical constraints required to extend battery lifetime in real applications.