How do I synthesize 3-hydroxydihydrofuran-2-one from formaldehyde?
Starting from pyruvic acid which is readily available and not very expensive: react pyruvic acid (only one enolizable side) with a Mannich base, then react the resulting amide with $\ce{MeI}$ and base to obtain the exo-methylene product. Brominate the exo-methylene. Now cyclization will prefer the five-membered ring over the strained four-membered ring. Reduce the ketone with a reletively mild reducing agent like $\ce{NaBH4}$ and then eliminate $\ce{HBr}$ in a E1cB type reaction, yielding 3-hydroxydihydrofuran-2-one.

This synthesis involves a Mannich reaction as you asked, but it can be done much simpler without it I think.

Note: I'm not an expert, just an enthusiastic amateur. Before trying anything in the lab  make sure your synthesis is checked by a supervisor.