In this paper, we consider the asymptotic behavior of Xfn(n)≔∑i=1nfn(xi), where xi,i=1,…,n form orthogonal polynomial ensembles and fn is a real-valued, bounded measurable function. Under the condition that VarXfn(n)→∞, the Berry-Esseen (BE) bound and Cramer type moderate deviation principle (MDP) for Xfn(n) are obtained by using the method of cumulants. As two applications, we establish the BE bound and Cramer type MDP for linear spectrum statistics of Wigner matrix and sample covariance matrix in the complex cases. These results show that in the edge case (which means fn has a particular form f(x)I(x≥θn) where θn is close to the right edge of equilibrium measure and f is a smooth function), Xfn(n) behaves like the eigenvalues counting function of the corresponding Wigner matrix and sample covariance matrix, respectively.