Let F be a totally real number field of class number one, and let K be a CM-field with F as its maximal real subfield. For each positive integer N, we construct a class group of certain binary quadratic forms over F which is isomorphic to the ray class group of K modulo N. Assuming further that the narrow class number of F is one, we construct a class field of the reflex field of K in terms of the singular values of Hilbert modular functions.