How long does a miscarriage take?

Hi ladies. Tuesday (4 days ago today) I started bleeding and cramping heavily. I went to the ER and I saw my baby at 6 weeks 2 days with a beating heart, but today my HCG levels came back and they are getting lower and lower, so my doctor informed me I'm miscarrying. My bleeding is getting worse and I'm still cramping. My question is, knowing my baby was alive and well only a few days ago, how long will this entire process take? How long will I bleed? I'm supposed to schedule an ultrasound in a week to confirm its all passed I guess, but I just don't know what to expect. Can anyone lend some insight?