I have Lupus that causes my scalp to flake. I found a physician (who I've been with for 9 years now) who helped me. I use Hydrocortisone cream. My problems are primarily around the hairline. I apply a small amount every evening before going to bed (I shower in the mornings). Occasionally it gets bad so I have to apply twice a day, but not often.
Also, weird as this sounds, don't shampoo your hair every day. It can dry your scalp out. I shower every day, but every other day, instead of shampooing and conditioning, I just condition. If you are someone who sweats alot or uses a lot of hair product and have to shampoo everyday, you might want to switch to a daily use or baby shampoo that is more gentle. Alternate between that and your regular shampoo.
And one more thing, when you find a product that your skin reacts kindly to (my Lupus causes my skin to freak out over almost anything), stick with it. Switching products can cause your skin to react. When you try something new, try only one thing at a time.
I've dealt with this since I was kid and I'm 33 now. It's never gone away, but it is under control.