From The Straight Dope:
There’s also a practical problem. You can’t have your name stricken from the Catholic membership rolls, because there aren’t any such rolls. Sure, some records may be kept at the parish level, and if you’re the determined type I suppose you could get your name crossed off those. But the church maintains no central registry. They figure God can keep track.
Fine, you say, but I still want to get excommunicated. OK, let me get out my–whoops, Buckland’s Complete Book of Witchcraft. Gotta get this library organized. Ah, here we are, the Codex Juris Canonici. As revised in 1983, there are nine grounds for excommunication–physical attack on the pope, “violating the sacred species,” procuring an abortion, etc…. all a little drastic. Your best bet is “apostasy, heresy, or schism,” canon 1364. Probably the simplest thing is to join the Presbyterians. Voila, latae sententiae (automatic) excommunication.
But I think what you’re after is an official pronouncement of excommunication (ferendae sententiae). Apparently the only way to do this nowadays is to make a conspicuous pest of yourself. The ultraconservative French archbishop Marcel LeFebvre did this by consecrating bishops without authorization, which got him excommunicated in 1988. If he could get himself formally kicked out, so can you, though it may require establishing your own schismatic sect.