A well played Riven can beat almost any championanyone in lane, especially melee champs. That being said, to deal with her in lane as Olaf I would start Cloth Armor + 5 pots and then build into Ninja Tabi and Wriggle's Lantern. These items allow you to sustain her harass through both increased armor and lifesteal.
Trading with Riven is very difficult, as she can easily use her abilities to run away or harass depending on how you play. If you notice that she uses several of her abilities in quick succession, take advantage of her 6-7 seconds of cooldowns to try to get your true damage off as she attempts to CS. Otherwise, there is not much you can do to her. Be very careful when she is about to hit level 6, as many Rivens like to go all in right when they get their ult.