In 1956, Tong established an asymptotic formula for the mean square of the error term of the summatory function of the Piltz divisor function d3(n). The aim of this paper is to generalize Tong's method to a class of Dirichlet series L(s) which satisfies a functional equation. Let a(n) be an arithmetical function related f t to a Dirichlet series L(s), and let E(x) be the error term of ∑'n≤x a(n). In this paper, after introducing a class of Diriclet series with a general functional equation (which contains the well-known Selberg class), we establish a Tong-type identity and a Tong-type truncated formula for the error term of the Riesz mean of the coefficients of this Dirichlet series L(s). This kind of Tong-type truncated formula could be used to study the mean square of E(x) under a certain assumption. In other words, we reduce the mean square of E(x) to the problem of finding a suitable constant σ* which is related to the mean square estimate of L(s). We shall represent some results of functions in the Selberg class of degrees 2 -4.