Do we have any account of the afterlives of Vasudeva, Devaki, Nandagopa and Yashoda? I generally hear about Nandagopa and Yashoda's last incident to be while they were being separated from Krishna, i.e. Krishna going to Mathura. About Vasudeva and Devaki, the last thing I heard was that they were freed after Kamsa's killing and Vasudeva was made the Crown Prince under King Ugrasena. Do we have any further stories or incidents where they have a role to play and also how did they die?
The last time that Krishna saw Nandagopa was during a pilgrimage to Kurukshetra. There was once a solar eclipse, so people from all over India made a pilgrimage to the Samanta Panchaka of five ponds of Kurukshetra. The Srimad Bhagavatam describes Krishna and the Yadavas meeting Nandagopa and Yashoda there:
Seeing Nanda, the Vṛṣṇis were delighted and stood up like dead bodies coming back to life. Having felt much distress at not seeing him for so long, they held him in a tight embrace. Vasudeva embraced Nanda Mahārāja with great joy. Beside himself with ecstatic love, Vasudeva remembered the troubles Kaṁsa had caused him, forcing him to leave his sons in Gokula for Their safety. O hero of the Kurus, Kṛṣṇa and Balarāma embraced Their foster parents and bowed down to them, but Their throats were so choked up with tears of love that the two Lords could say nothing. Raising their two sons onto their laps and holding Them in their arms, Nanda and saintly mother Yaśodā forgot their sorrow.
But that was not the last time Krishna saw Yashoda. When Yashoda was on her deathbed, Krishna came to visit her. Yashoda told him that her one regret in life was that she never got to see any of Krishna's marriages. So Krishna promised her that in a future birth she would see him get married. Yashoda was reborn in the Kali Yuga as Vakuladevi, and she got to see the marriage of Venkateshwara (the Vishnu deity in Tirupati, AKA Balaji or Srinivasa).
As I discuss in this answer, Krishna died after being shot by a hunter who mistook his foot for the mouth of a deer. And after Krishna's father Vasudeva heard the news, he gave up his body the next morning, as described in the Mausala Parva of the Mahabharata:
Arjuna passed that night in the mansion of Keshava. He was suddenly overwhelmed with great grief and stupefaction. When morning dawned, Vasudeva of great energy and prowess attained, through the aid of Yoga, to the highest goal. A loud and heart-rending sound of wailing was heard in Vasudeva’s mansion, uttered by the weeping ladies. They were seen with dishevelled hair and divested of ornaments and floral wreaths. Beating their breasts with their hands, they indulged in heart-rending lamentations. Those foremost of women, Devaki and Bhadra and Rohini and Madira threw themselves on the bodies of their lord.
And then Vasudeva's four wives, including Devaki, threw themselves into the funeral pyre:
The body of the hero was followed by his wives decked in ornaments and surrounded by thousands of women and thousands of their daughters-in-law. The last rites were then performed at that spot which had been agreeable to him while he was alive. The four wives of that heroic son of Sura ascended the funeral pyre and were consumed with the body of their lord. All of them attained to those regions of felicity which were his.