We've never had any hang on that long before but our vet says to just twist it around a small stick and pull it out if it's still there after a couple days. They will sometimes snag it on a briar or fence barb but he says not to leave it there too long - invites too many problems.
Three weeks is a long time for it to still be in there. What is inside is rotting. You can try to pull it out, but as long as it has been in there it is highly likely to tear off inside of her and that's worse that what you have now. I would give her an antibiotic to combat the rotting mess inside of her. I would also give her a hormone which causes her to try to push it out. We have used it before, but I don't remember the name of it. Talk to your vet about it.
Oxytocin might be what you need. It causes contractions to aid/assist in birthing (if needed) and help get the afterbirth out. CALL the vet to come out & he will probably do a 'douche' on her & give her anibiotics. She will die if you leave it in.....the longer it is in there the harder i it is on her & a longer 'recoup' time IF she makes it.