The short answer is, I set DCs to what feels right. Often I don't set them at all; I just make the players roll, and if they get good rolls, they succeed. If they get marginal rolls, they marginally succeed, or have at least enough success to keep trying, and if they roll a 1, well, they already know what happens.
If you want to be technical about it, YOU need to make a decision about how hard something should be. You can either decide this based on the task, or based on the PCs. If you decide based on the task, you may end up with tasks the PCs cannot reasonably accomplish (ie, a DC higher than any PC can roll). If you decide based on PC ability, you determine how easily you want the PCs to succeed, and then make up a DC to fit.
If something is possible for a common person to do, it has a DC of 20 or less. If it's likely a common person can do it, the DC is less than 10, and is probably not worth rolling for. If the common person can't do it, the DC is higher than 20.
The otherway is to look at the PCs skills. If you want the party to have a 50% chance of accomplishing something, look at the relevant skill and add 10 to the score - so, if the party has a 50% chance of talking their way in to see a noble, the DC would be (Diplomacy score = +12) approximately 22. Beyond the reach of a common person, but well within the party's capabilities.
Some people (like me) have an easier time thinking of probabilities in percentages. I think of somethign as being 50% likely, or 85% likely - it's pretty easy to convert that to 1-20 scale.
Hope that helps.