  We consider sums of Hurwitz class numbers of the type $\sum_{t \equiv m
\pmod{M}}H(4p-t^2)$, where $M$ is composite. For $M=6$ and $8$, we show that
these sums can be expressed in terms of coefficients of CM cusp forms. This
leads to explicit formulas which depend on the expression of $p$ in the form
$x^2+ny^2$.
