The evolution of young HII regions: I. Continuum emission and internal dynamics