Let $(X, \omega)$ be a compact Kähler manifold and $E$ a vector bundle on $X$ with hermitian metric $h$. Let also $F_h$ be the curvature of Chern connection on $(E, h)$. It is a $(1,1)$-form with coefficients in $\operatorname{End}(E)$.
In Simpson's paper "Higgs bundles and local systems" the following formula plays important role: $$ \int_X \operatorname{Tr}(F_h \wedge F_h) \wedge \omega^{n-2} = C_1||F_h||_{L^2} - C_2||\Lambda F_h||_{L^2} $$ for certain constants $C_1$ and $C_2$ (here $\Lambda$, as usual, is the hermitian-adjoint to the Lefschetz operator $L \colon \eta \mapsto \omega \wedge \eta$)
Indeed in Simpson's paper this equation is used not for a curvature of a unitary connection, but for a pseudocurvature of a hermitian metric on vector bundle endowed with flat connection . However, I believe it is not really important and the proves must be similar.
It seems that this relation holds in a general situation and follows from some standard Hodge theory. Although I don't understand how to prove it.
Simpson claims that this fact follows from "Riemann bilinear relations", but I don't understand what he really means.
By Chern-Weil theory for $τ$-Hermitian-Einstein structure we have
$$2\pi\tau\int_Xc_1(E)\wedge\frac{\omega^{n-1}}{(n-1)!}-8\pi^2\int_Xch_2(E)\wedge\frac{\omega^{n-2}}{(n-2)!}=\tau\int_Xtr(\sqrt{-1}\Lambda_\omega F_H)\frac{\omega^n}{n!}+\int_Xtr(F_H\wedge F_H)\wedge\frac{\omega^{n-2}}{(n-2)!}$$
Then from this you can get your identity. See this lecture note