As mentioned by Toast in his answer , one of the bigger things to learn is how to last hit under a tower. If an enemy is constantly pushing you to tower, learning the 2T-1 combo for melee minions (2 Tower, 1 auto), and 1-T-1 for caster minions (1 auto, 1 Tower, 1 auto) is essential for keeping your CS up whilst under pressure. CS is arguably one of the most important statistics for champions to improve upon, and mid lane is no exception.
More specifically, to address your question regarding characters with high harassment capabilities, there are several ways you can improve upon.
1) Call for a gank. If you have a jungler, they're the obvious choice to do so. If you aren't running with a jungler in lower level games, either one of the sidelanes can come up and attempt a gank.
2) Punish them when they harass you: harass them back! Typically if an enemy is harassing you, they're opening themselves up to punishment in the form of:
- Putting themselves out of position / pushing too far away from their tower
- Using up mana
- Using up cooldowns
Watching for an opening is crucial to monopolizing on your strengths as a caster in the laning phase. In your example of Ryze vs. Brand, as soon as Brand uses his Pillar of Flame to try to set you alight, you should know that he's looking for an opening to stun you with Fireball. However, if you keep yourself behind minions, he wont be able to do that, and if he tries to come close, you can Q - W - Q combo him. At early levels, most casters are very squishy and have poor sustainability, so even something as simple as 3 spells may very well outright kill them, especially if paired with Ignite.
3) Change your starting items. As Ryze, it's incredibly tempting to start with a Mana Crystal for that extended time in lane and the extra power on your Q and W. However, since many AP champs are strong at harassing with a lot of range and/or spammy spells, it's not always the best option. Boots 1 and 3 health pots is a very safe way to start the game. It allows you that extra speed to dodge skillshots and get out of ground effects, plus 3 "crap I messed up" buttons as opposed to 2 or less. Specifically in the case vs. Brand, dodging his Pillar is the fastest way to put him behind, as it's his only great harassment tool until level 8 or so, when he can start getting more points in E.
4) Get that blue buff. Unless you're a manaless champion like Kennen, Vladimir or Morde in mid, your jungler should be giving you the Blue Golem buff no later than on the 3rd spawn, if not earlier. This depends on the jungler, of course (Fiddlesticks and Amumu are much more mana reliant than others, for example, while Lee Sin and Shyvana don't even use mana), but having Blue buff drastically reduces your reliance on Mana and allows you to harass / last hit with less discretion.
Lastly, and not really a point, but don't be discouraged by certain pair ups. There are a lot of clear winner matchings, and Ryze is one of those champs that suffers a little bit from early game weakness simply because he doesn't have the items to provide him the sustainability that he needs to fall into the chain caster category. Some great champs to learn for mid lane if you want to be the one doing the harassing fall into a few categories:
- Xerath and Ziggs are both super long range harassers that can farm well even at a distance.
- Cassiopeia and Karthus are very spammy types that punish enemies for even one misstep.
- Leblanc (and to a lesser degree, Veigar and Annie post 6) have the potential to kill you even if you're at full health with their full combo, and provide powerful zoning as a result.
- Galio is typically picked as an anti-caster pick, but fares well in mid due to typical lineups. Early game his spells hurt a lot even without AP or MR items to boost, and he can bully enemy mages due to his higher durability and their lower early game sustain.
- Vladimir, Mordekaiser and Kennen are all great harassers due to their lack of mana reliance, and Vladimir even more so due to his natural leech through his Q and his passive synergy between AP and HP.