I always complain if it is somethig downright dangerous like undercooked chicken or not fully reheated food.
If I just don't like it, but it is perfectly competently cooked then that is my problem and I would keep it to myself..
As for the other times, when the food is just not any good, I will point it out, but I usually refuse a replacement ( to avoid the spitting in your dinner)
I have found the easiest way to broach it is to wait until they ask, which they usually do, and just say "actually, the meal is not very good/overcooked/or whatever the case"
If you don't give feedback, you are not giving them the opportunity to improve and therefore their business will go down the pan and they wil not know why, you do get the odd occaision when they couldn't give a toss - usually if they have a lot of tourist business, and don't really rely on their reputation.
Sounds like I complain a lot, but I don't proportionally, I just eat out quite a bit!!