I used to have a LOT of problems with my knees (one knee in particular). I try not to point my toes down, warm up slowly (no hills the first 10-15 minutes or high gears), make sure my seat is adjusted at the right height (not too low, not too high), and I do not wear cleats because I find when my feet are constrained in any one position, I can't make natural adjustments that I have learned to make over time depending on my flexibility and fitness level to avoid knee pain. When I was exercising over the winter in the gym on the stationary bike and treadmill, I started having a lot of knee pain - but stretching and thoroughly warming up with 15 of low intensity exercise totally eliminated the problem.
Good luck finding what works for you. I believe a lot of knee problems are due to a combination of:
1) Lack of warm-up and going too hard or too fast too soon
2) Fitness levels and flexibility - what stage you're in when the problem occurs (early season, mid season, etc.) - and the need to make proper adjustments.