A two-layer coordinated control strategy is proposed to solve the power allocation problem faced by electric–hydrogen hybrid energy storage systems (HESSs) when compensating for the fluctuating power of the DC microgrid. The upper-layer control strategy is the system-level control. Considering the energy storage margin of each energy storage system, fuzzy logic control (FLC) is used to make the initial power allocation between the battery energy storage system (BESS) and the multistack fuel cell system (MFCS). The lower-layer control strategy is the device-level control. Considering the individual differences and energy-storage margin differences of the single-stack fuel cell (FC) in an MFCS, FLC is used to make the initial power allocation of the FC. To improve the hydrogen-to-electricity conversion efficiency of the MFCS, a strategy for optimization by perturbation (OP) is used to adjust the power allocation of the FC. The output difference of the MFCS before and after the adjustment is compensated for by the BESS. The simulation and experiment results show that the mentioned coordinated control strategy can enable the HESS to achieve adaptive power allocation based on the energy storage margin and obtain an improvement in the hydrogen-to-electricity conversion efficiency of the MFCS.