As for direct contributions to candidates who are unsuccessful, there are several ways in which they may dispose of contributions. They may use them to retire campaign debts, donate them to other candidates or to the party (subject to campaign finance limits), return them to donors, donate to charity or hold the funds in an account for use in a future campaign.
N.B. my information is pre-McCain-Feingold so there may be specifics which have changed. McCain-Feingold itself is up in the air at the moment.
As for money donated directly to the DNC, it may use that money for general ads or donate directly to candidates. The rule pre-McCain-Feingold was IIRC that the ads could say pretty much anything except “vote for (candidate).”
The main reasons for donating money to a candidate at this point are 1) to keep the campaign going and 2) to help the candiadte raise more money by helping them demonstrate their ability to raise money. At this stage the ability to raise money is about of the same level of importance as standings in the polls (and of course the two are linked; the better off in the polls the more likely someone will donate and the more money a candidate has the more likely it is that people have heard of them and might support them).