Infrared emission of dusty H II regions