A D&C or vacuum aspiration to treat miscarriage should not be painful if adequate anesthesia is used during the procedure. D&Cs and vacuum aspirations performed under general anesthesia should be completely painless, as you will be asleep during the procedure (though there may be some cramping during recovery).
But because that general anesthesia carries some risks and that hospitalization is expensive and more traumatic for some women, it's become more common that these procedures are performed on an outpatient basis in doctors' offices. With an in-office D&C or aspiration, you may be awake and local anesthesia such as a cervical block may be used. In most women, the local anesthesia should be sufficient to prevent serious discomfort or pain, but some women have cramping despite local anesthesia and a small percentage describe the experience as severely painful. For this reason, some doctors also use sedatives or other medications in women having outpatient D&C or vacuum aspiration.
To make sure you know what to expect, talk to your doctor before the procedure and share any concerns you have about pain management. You can then work with your doctor to devise a plan that best meets your needs.
Edwards S, Tureck R, Fredrick M, Huang X, Zhang J, Barnhart K. "Patient acceptability of manual versus electric vacuum aspiration for early pregnancy loss." J Womens Health (Larchmt). 2007 Dec;16(10):1429-36.
Gómez, Pio Iván; Gaitán, Hernando; Nova, Casilda ; Paradas, Alejandro. "Paracervical Block in Incomplete Abortion Using Manual Vacuum Aspiration: Randomized Clinical Trial." Obstetrics & Gynecology:May 2004 - Volume 103 - Issue 5, Part 1 - pp 943-951.
Manual Vacuum Aspiration (MVA) for Uterine Evacuation: Pain Management. Ipas. Accessed: 14 May 2010. http://www.ipas.org/Publications/asset_upload_file905_2468.pdf
Renner, Regina-Maria, Jeffrey T.J. Jensen, Mark D.N. Nichols, Alison Edelman. "Pain control in first trimester surgical abortion." Cochrane Database of Systematic Reviews 2009, Issue 2.