The global push towards reducing emissions in road transport has intensified, necessitating the adoption of more sustainable powertrain solutions. Fuel cells have emerged as a prominent alternative to solve the limitations associated with battery-powered vehicles, such as range anxiety and excessive weight. Specifically, this study focuses on heavy-duty vehicles sector and seeks to simultaneously accomplish vehicle design and proper energy management of a hybrid truck utilizing both fuel cells and batteries. Therefore, a model-based approach is used to develop a techno-economically viable co-design procedure, which iteratively changes the design parameters (i.e., fuel cell system rated power and battery specific energy), to allow maximizing vehicle fuel economy over a designated driving mission. Such a task is successfully executed through the implementation of a versatile rule-based control strategy suitably tailored to meet the specific requirements of heavy-duty vehicles. Moreover, the fuel cell system has been modeled as a finite state machine, with its operating behavior, depending on power request, managed via Boolean-like rules in Stateflow environment. Since a fuel cell-based truck is a suitable choice, especially when there is no time for rapid battery charging, the proposed co-optimization faces several scenarios, distinguished by the allowable post-driving battery charging time. This holistic approach aims to fine-tune the vehicle's energy use, ensuring optimal performance and meeting predefined criteria, with a primary emphasis on increasing fuel economy. Considering the HHDDT driving cycle, results close to 11.10 km/kg are achieved in the various scenarios. Furthermore, the influence of the payload capacity on the optimal design was also investigated, along with the effects of different driving routes. The shift to the ETC-FIGE resulted in a 2% reduction in fuel economy, leading to fuel cell system and battery capacity downsized by approximately 18% and 20%, respectively, depending on the admitted post-driving recharging time.