My doctor recommended to start intercourse again after I had my first period following the miscarriage. He said that the time helps the body and the emotions recover.
My midwives always said 2 weeks. We did not wait that long, we were very gentle and used condoms but it was still somewhat painful until at least a week or so after the procedure.
I always waited until my follow up appointment, usually two to three weeks after. Its been awhile though, probably best to ask your doctor.