Let $h\_d$ be the number of $SL\_{2}(\mathbb{Z})$ classes of primitive binary quadratic forms of discriminant $d$. It's natural to impose the hypothesis that $d$ is not at square, as we do below. 


In Carl Ludwig Siegel's paper titled *The Average Measure of Quadratic Forms With Given Discriminant and Signature* Siegel cites two formulae given by Gauss in *Disquisitiones Arithmeticae*: 


(a) $\displaystyle\sum\limits\_{d= -N }^1 h\_d \sim \frac{\pi}{18 \zeta(3)}N^{3/2}$ 


(b) $\displaystyle\sum\limits\_{d = 1}^N h\_d \log{\epsilon}\_d \sim \frac{{\pi}^2}{18 \zeta(3)}N^{3/2}$ 


Where $N > 0$ and $\epsilon\_{d} = \frac{1}{2}(t + u \sqrt{d})$ where $(t,u)$ is the smallest positive solution to $t^2 - ud^2 = 4$.


(Actually, Gauss restricts to consideration to binary quadratic forms with even middle coefficient correspondingly arrives at different formulae, but they're essentially the same as those above).


Siegel gives two proofs of these formulae: one proceeding from Dirichlet's class number formula together with character sum estimates due to Polya and Landau, and one via a direct lattice point counting argument. 


In light of the facts that (i) I haven't heard anyone say that Gauss's was the one to discover the class number formula and (ii) the character sum estimates seem outside of the scope of Gauss's work, I imagine that his argument was via lattice point counting. Do we have any evidence otherwise? (I checked Gauss's book and he doesn't describe his methods there.)



Did Gauss know Dirichlet's class number formula in 1801?
In 1801, Gauss certainly was aware of the general procedure to obtain the class
number formula (or asymptotic results) via counting lattice points. As a matter of fact, the approach using lattice points in general, and Gauss's circle problem in particular, can already be found in Legendre's Essai sur la Théorie des Nombres in 1798, in connection with his approach to the three-squares theorem. 


There do exist a couple of posthumous papers by Gauss on this topic, which can be found in his collected works as well as in Maser's German translation of the Disquisitiones (but not, unfortunately, in the English translation). In fact Gauss attempted twice to publish his proof of the class number formula; the first attempt begins with the sentence "33 years have passed since the principles of the wonderful connection, to which this memoir is dedicated,
was discovered, as I have remarked at the end of the Disquisitiones". Here Gauss refers to the last paragraph of the Disquisitiones, where he reports to have discovered the analytic solution to a problem stated in articles. 306 and 302. The second version of his manuscript begins with the same sentence, except that the 33 years have been replaced by 36 years.


In any case what this means is that the question in your title should be answered with a firm "yes".


