The support of combined heat and power production systems has gained policy attention, because these are often considered to be less polluting and more efficient than conventional energy conversion systems. As a consequence, the potential market for these energy systems that contribute to reduce greenhouse gas emissions and to enhance energy security on a national level, is shifting from large-scale existing units to small and micro-size emerging technologies. This paper presents a numerical model based on a cost-benefit analysis used to design an optimal cogeneration system for a small-scale building application, considering the Portuguese context and the comparison with the harmonized efficiency reference values for the separate production of electricity and useful heat. The model includes the identification of the objective function terms (i.e., the elements involved in the financial analysis across the system lifetime and the economic evaluation of costs) and benefits of the combined heat and power production system. The economic viability of cogeneration systems significantly depends on system technology, client energy requirements and support schemes implemented in the respective countries. A strategic approach is necessary to adequately embed the new technology as a feasible solution in terms of investment and operational costs. Only by matching the energy supply to the needs and expectations of the energy users, it will be possible to improve the market competitiveness of these alternative power production plants. The optimal solution disclosed a positive annual worth, which is higher if the carbon emission savings are monetized. In addition, the optimal system represents a more efficient way to produce useful heat and electricity (i.e. a positive primary energy saving) and to reduce gas emissions. A cost-benefit analysis can be applied for the techno-economic evaluation of a CHP system by assessing the monetary socio-environmental costs and benefits of a capital investment over its useful lifetime.