I'm somewhat confused about the definitions of Betti numbers for Riemannian manifolds. Working with the first Betti number as an example, I have usually taken the definition to be the rank of the homology group $H_1(M)$, where $M$ is the manifold in question. I'm also aware that through a Hodge-theoretic argument, we have that the first Betti number is equal to the dimension of the space of harmonic 1-forms on $M$, and that in fact this space is isomorphic to $H^1(M; \mathbb{R})$.

So my question is essentially: How do we get an isomorphism $H_1(M)\cong H^1(M; \mathbb{R})$?

I know that through Poincaré duality we have the isomorphism $H_1(M) \cong H^{n-1}(M; \mathbb{Z})$ but I can't see how this helps.