If you want to study class number theory, I suggest going at it through Galois theory (i.e. through algebraic number theory) and not through Gauss' theory of binary quadratic forms. The two theories are equivalent on some level, but the first approach is more modern and lends itself better to generalization. There are many good books on algebraic number theory.

If you want to study quadratic forms in a general setting, I suggest Serre's bookA Course in Arithmetic, which is really a classic. It's a tiny book, very dense, and written in the most elegant fashion. In this book, Serre classifies quadratic forms over the rationals and over the P-adic fields. The book also contains modern proofs of classical results concerning the representations of integers by quadratic forms. (The scope of the book is much wider than quadratic forms, however - that's only one chapter!)