This excerpt from the Shatarudra Samhita of the Shiva Purana describes the birth of Nandi and how he became the leader of Shiva's Ganas. He is not referred to as a bull at all; here's how Nandi describes his appearance at birth:
On seeing me the boy with three eyes, four arms and lustre like that of Yama, sun and fire and clad with matted hair and coronet, [Nandi's father] Shilada was delighted. I was in the form of Rudra in every respect with the trident and other weapons.
After he is appointed by Shiva, he acquires six more arms:
O Brahmin, as soon as that garland adorned my neck I became three-eyed and ten armed like another Shiva.
And Shiva is already referred to as the "bull-bannered lord" in this story.
According to this Wikipedia page, it's only recently that Nandi has been conflated with Shiva's bull:
The application of the name Nandi to the bull (Sanskrit: vṛṣabha) is in fact a development of recent centuries, as Gouriswar Bhattacharya has documented in an illustrated article entitled "Nandin and Vṛṣabha".
But unfortunately I couldn't find Bhattacharya's article. But I did find one reference to Nandi being Shiva's bull in the Srimad Bhagavatam. As I discuss in this answer, Krishna and Shiva once fought each other, because Krishna was fighting the demon Banasura who was a devotee of Shiva. In any case, Shiva is described as riding on Nandi:
Lord Rudra, accompanied by his son Kārtikeya and the Pramathas, came riding on Nandi, his bull carrier, to fight Balarāma and Kṛṣṇa on Bāṇa’s behalf.
But it's possible this verse is an interpolation.
You also wanted to know about Shiva's bull. Its story is described in this chapter of the Anushasana Parva of the Mahabharata. The divine cow Surabhi emerges from the mouth of Brahma's son Daksha. It produces a number of offspring, who spray their froth onto Shiva, who becomes furious and curses them to change color. Daksha pacifies Shiva by telling him that the froth of cows is holy, and then he gives Shiva a bull and a few other cows:
Having said these words, the lord of creatures, Daksha, made a present unto Mahadeva of a bull with certain kine. Daksha gratified the heart of Rudra, O Bharata, with that present, Mahadeva, thus gratified, made that bull his vehicle. And it was after the form of that bull that Mahadeva adopted the device on the standard floating on his battle-car. For this reason it is that Rudra came to be known as the bull-bannered deity. It was on that occasion also that the celestials, uniting together, made Mahadeva the lord of animals. Indeed, the great Rudra became the Master of kine and is named as the bull-signed deity.
Note that in this excerpt from the Brahma Khanda of the Brahma Vaivarta Puranas, Surabhi is said to have emerged from the body of Vishnu, not Daksha, and it is Vishnu who gives Shiva his bull. (Perhaps one of these stories is an interpolation.) In any case, one thing is clear: Shiva's bull is a descendant of the divine cow Surabhi.