A harsh reality of League of Legends is that at some point you're going to get counter picked. It sucks, I know, but it happens to everyone at some point. You may lock in Karthus and then have to go up against a Kassadin, or you may lock in Katarina and have to go up against a Diana, but you know that the next 30 minutes of your life are going to suck. If your opponent is smart and as good as you, this is probably going to be true, but a very unique skill to have is being able to win a lane that's supposed to be unwinnable. This is going to take a fair amount of practice, but if you get good enough at it, you'll be perfectly happy locking in your favorite champion even in the face of inevitable counter pick. In this guide I'll do my best to explain how to win an unwinnable lane. Here are some of the champions that you probably hate and whom this guide is really about: Kassadin, Fizz, Diana, Annie, LeBlanc, Akali, Master Yi, Talon, and Zed.
Step One: Runes and Masteries
Usually pretty obvious, but I'll go into detail.
My standard rune page on my main mid champions (Gragas, Lissandra, and Viktor) are hybrid reds, armor yellows, flat MR blues, and AP quints. This provides a good mix against most counter picks, but I also have a secondary page called "pls dnt kil me ;_;" and it has hybrid reds, armor yellows, flat MR blues, and flat health/5 quints. In very dangerous lane cases I'll run this page. Additionally, the majority of the time I'll skip utility masteries all together and just go 21/9, or again, in horrible cases, 9/21.
[Note: some people actually take AD reds and quints against assassins, and I do from time to time as well. It helps you do much more damage early on and delay that champion's level 6 for as long as possible. It may be the smartest way to go about this.]
Your goal at this stage of the game is to just survive by all means possible. Most of the above champions can be abused up until levels 3-4, and some all the way up until level 6, but you need to be prepared for the inevitable turn when they decide to kill you. Having even an extra 30 health can make all the difference.
Step Two: Test your Opponent Out
In levels one and two, you should be checking out what kind of player your opponent is. Some people are extremely aggressive. Some are very passive. Knowing this will help you play against them.
A very important feature in League of Legends that very few people know about is that whenever your opponent comes in to harass you, the champion glows orange very faintly. You can check it yourself with a friend: when they have right clicked on you to auto attack you, they will turn orange. This often gives you a full extra second of warning before they start AAing, so if you see them constantly turning orange early on, you know their intention is to kill you early. What do we do now?
Well, if you're stronger than them, fight back. If you're not--and against champions like Fizz, from level two you will not be strong enough to 1v1 him, turn around and walk away. Does he follow you past your melee minions? He's either trolling or stupid. It is incredibly reckless to overextend like this and he can completely ruin his team's chances of winning the game if he goes past your melee minions and gets ganked. Most players who glow orange constantly will do it too. Maybe tell your jungler about this? Bait them back, and if they attack you, use minion damage and a couple of spells to ruin their day. Minions are the bane of assassins' existence.
Step Three: Survive
This gets easier as the game goes on. It doesn't matter if you're 10, 15, or 30 CS behind. If you are playing a standard AP champion, you are better in teamfights. Way better. Just turn on your passive AP farm mode and use spells to last hit at tower. Go B after every cannon minion wave (or every other) to miss the least CS possible. I love picking up an early Chalice of Harmony/Athene's Unholy Grail against AP assassins because it is practically the perfect anti-assassin item (huge mana regen, MR, CDR, some AP). An early Negatron Cloak is another wonderful way to piss them off.
If your opponent cannot kill you by level 8, he will get frustrated. He wants to kill you. He wants to snowball. You're too smart for that though. You're not going to let it happen.
Step Four: Never, Ever, Follow
Now your opponent starts roaming. He needs kills. He's frustrated that you're giving up less than a Mormon girl on prom night. Spam MIA like a monster and start pushing the lane. DO NOT FOLLOW; HE WILL KILL YOU IN RIVER. If he gets a double kill in your bot lane, and they cry about you not following, ignore them.
When you follow an AP assassin, you die as a standard AP. They can just wait in bushes--such as the small one near dragon--and twoshot you if you come near. You have no way to defend yourself here. It's not worth feeding a kill to them because you're afraid of your other lane whining. Assassins are meant to roam. You can't stop them from roaming.
Step Five: Profit in Teamfights
I believe that the average assassin can deny you 20% of the farm that you would have gotten otherwise. If you're aiming for 300 farm by 35 minutes, that means you'll be around 240. 60 minions is only a difference of like 1,000 gold. It sucks but the fact that you do a lot more AOE damage in teamfights than him makes up for that fact tenfold. If an assassin can't get fed early, you will be delaying his big items and fights around dragon/baron/towers will go a lot more smoothly. You will win by allowing yourself to lose early.
Wrap Up
You need to change your playstyle against assassins drastically to win. I recommend practicing in 1v1 with a friend to do this. Assassins are high risk high reward champions, and the best counter to them is really smart play.