This paper models a class of hierarchical cyber-physical systems and studies its associated consensus problem. The model has a pyramid structure, which reflects many realistic natural or human systems. By analyzing the spectrum of the coupling matrix, it is shown that all nodes in the physical layer can reach a consensus based on the proposed distributed protocols without interlayer delays. Then, the result is extended to the case with interlayer delays. A necessary and sufficient condition for consensus-seeking is derived from the frequency domain perspective, which describes a permissible range of the delay. Finally, the application of the proposed model in the power-sharing problem is simulated to demonstrate the effectiveness and significance of the analytic results.