My father worked with dairy cows as a side job during college. He said they were often very friendly (except for Holsteins, they can be mean). They get used to and expect the daily routine - milking in the morning, pasture for the day, milking in the evening, pasture for the night.
When milking time came, they'd all be crowded up near the gate waiting for him to open it so they could walk to the milking building. They didn't need to be coaxed.
He said the saddest thing was the practice of de-horning calves at a certain age. Prior to that, a group of calves would be friendly, unafraid, almost like pets. But afterwards (my dad wasn't personally there for the actual de-horning) they would all crowd together at the opposite end of the yard in fear when he approached. He said it was heartbreaking...
As far as I know, not all farmers practice de-horning.
Edit: I have no idea whether they used pain killers, but given the calves' response my guess is no.