We establish a new combinatorial identity related to the well-known Bernoulli numbers, which generalizes the result due to Feng and Wang. By means of the identity, we find a recursive formula for successively determining the coefficients of Ramanujan's asymptotic expansion for the generalized harmonic numbers.