They were the errand-riders sent from Gondor to ask for Rohan's help in the defense of Minas Tirith. I assume that Shadowfax called to them because he sensed they were friendly.
They meet with King Theoden at Harrowdale and present him with the Red Arrow (the sign that Gondor invokes the alliance between the two countries).
He sank to one knee and presented the arrow to Theoden. "Hail, Lord of the Rohirrim, friend of Gondor!" he said. "Hirgon I am, errand-rider of Denethor, who bring you this token of war. Gondor is in great need. Often the Rohirrim have aided us, but now the Lord Denethor asks for all your strength and all your speed, lest Gondor fall at last.
The Return of the King Chapter III (The Muster of Rohan)
After Theoden says he will ride to Gondor, the errand-riders set off home, but were killed before they could make it, so that Gondor didn't know that Rohan was coming to their aid. Theoden is told of their deaths.
But soon Elfhelm returned. "The scouts have found naught to report beyond the grey wood, lord" he said "save two men only: two dead men and two dead horses"
"Well?" said Eomer. "What of it?"
"This lord: they were errand-riders of Gondor; Hirgon was one maybe. At least his hand still clasped the Red Arrow, but his head was hewn off. And this also: it would seem by the signs that they were fleeing westward when they fell. As I read it, they found the enemy already at the out-wall, or assailing it, when they returned - and that would be two nights ago, if they used fresh horses from the posts, as is their wont. They could not reach the City and turned back."
"Alas!" said Theoden, "Then Denethor has heard no news of our riding and will despair of our coming."
The Return of the King Chapter V (The Ride of the Rohirrim)
Additional information from the comments (thanks to Matt Gutting and Jelsema)
The above quote only accounts for two of the three riders (Hirgon and one of his companions). The fate of the third is not known; we can suppose that he was killed somewhere else, or even managed to escape. He could not have returned to Minas Tirith as word of the Ride of the Rohirrim did not reach the city until their horns were heard at cock-crow in the Battle of the Pelennor Fields.