Given the potentially significant role of buildings in reducing the urban greenhouse emissions and reshaping the urban future towards sustainability, in the last few years, many research activities have been focused on design of high-performing buildings. It is widely recognized that the highly-performing building of the future will have a very low energy demand and that renewable energy sources should have the leading role in supplying the energy needed. Furthermore, such high performance of the building should ensure not only the environmental but also the economic sustainability. In Europe, the European Directive on the Energy Performance of Building (EPBD - 2010/31/EU) introduced, together with the idea of nearly Zero Energy Buildings, the key-concept of cost optimality that provides a methodology for evaluating the economic performance of the building over the estimated lifecycle. Results from many applications of the cost optimal analysis across Europe demonstrated that nowadays there is still a gap between the building environmental optimum and the economic optimum and therefore many research activities are being carried out on design methods and policies and measures with the goal of reducing this gap. In this context, the ZEB design results as the solution of a complex optimization problem, as it was demonstrated that the best performance does not result from a single pre-defined set of energy efficiency measures applied to the building, but it is strictly related to the local scale, depending on the interaction of the many design variables with the boundary conditions (climate, availability of technologies, investment and operational costs, urban context, ...). Therefore, this work aims at identifying the key variables, stating the optimization objectives and developing an automated methodology for effectively supporting the solution of such a complex design optimization problem. A comprehensive review on the studies related to NZEB design reports the state of the art on the topic, emerging trends and open issues in the field. Based on this background, the NZEB design optimization problem is stated and investigated in all its phases. A simulation-based optimization method is set up and tailored on the so-defined design problem. Insights on different aspects related to the NZEB design problem are provided through several applications on representative case-studies, which validate and refine the proposed methodology framework. The mutual relationships between envelope and systems in determining the NZEB optimal design solutions are demonstrated and quantified. Special attention is given to the evaluation of the resilience of the resulting optimum to the variation of future climate scenarios: it was demonstrated that the higher performance of the building systems, the higher resilience to possible future climate change. The advantages of implementing an integrated approach by means of energy demand and supply simultaneous optimization rather than a traditional sequential approach are quantified and discussed. Energy and cost performance optimization for the building operation is also investigated in a context of social housing, while the combined evaluation of comfort conditions within the energy design optimization at the early design stage is studied. Such methodology is demonstrated to be able to effectively support the integrated NZEB design process with a high-level of accuracy and a manageable computation time. It was demonstrated it can lead to increase the building performance by up to 40\% (depending on the objective) with respect to current construction practice. Several applications in real contexts also demonstrate the high-potential of such framework in successfully supporting the design process beyond theory. In fact, the developed methodology framework was successfully applied to collaborate with other researchers and professionals to calibrate energy models, to optimize the design and operation of innovative energy systems, to optimally combine energy, cost and acoustic high-performance in a NZEB, to support effective communication to clients...and even to win an international contest on design and construction of a NZEB prototype.