Let her start eating a little grain out of a bucket sitting on the ground with you in the pen with her. I like to shake the bucket before I set it down on the ground (this will come in handy later if you accidentally leave the gate open and you have 40 cows roaming up and down the road eating all your neighbors flowers). Start moving closer and closer to the bucket, either sitting or kneeling on the ground and talk softly to her while she is eating. After a few days of this you should be able to hold the bucket propped up on your knee and let her eat out of it. Once she starts doing that gently scratch her on the neck, and when she gets used to you scratching her on the neck with you holding the bucket on your knee, then sit the bucket on the ground between your feet and start scratching her between the shoulder blades (they really love that). Once she's built up enough trust in you to let you start scratching her on the back its all down hill from there. Remember all this is really dependent on her attitude, some take right to it and some are "flighty", just be patient and keep working with her, she'll come around.
I have about 8 that are absolutely rotten, all my neighbors laugh at me out there scratching on my cows.
Cows aren't as stupid as most people think, they'll have you trained before you know it!