Text and Source:
The hadith is as follows:
خلق الله آدم حين خلقه فضرب كتفه اليمنى فأخرج ذرية بيضاء كأنهم الذر وضرب كتفه اليسرى فأخرج ذرية سوداء كأنهم الحمم فقال للذي في يمينه إلى الجنة ولا أبالي وقال للذي في كفه اليسرى إلى النار ولا أبالي
God created Adam when He created him and struck his right shoulder and brought forth his offspring white like small ants. And he struck his left shoulder and brought forth his offspring black as though they were charcoal. Then He said to the party on his right side, ‘To paradise, and I do not care’ and He said to the party in his left shoulder, ‘To hell, and I do not care’.
— Mishkat al-Masabih
This exact wording has been recorded in Musnad Ahmad , Musnad al-Bazaar , Musnad al-Shaamiyeen al-Tabaraani , Tareekh Dimashq Ibn 'Asaakir.
Tirmidhi , Abu Dawud and others have recorded a similar hadith but with different wording.
Other reports are also narrated in Tafsirs of the verse Quran 7:172.
As for the hadith with this exact wording, there is a transmitter in the chain of the hadith named Sulaiman bin 'Utba ( سليمان بن عتبة ) also known as Abu al-Rabi' ( أبو الربيع ) whose reliability is disputed, as he is considered weak by Ibn Ma'in and some others. As such some scholars have classed this hadith as Da'eef (such as Al-Arnaa’oot) and some have classed it as Hassan (such as Zubair Ali Zai) or even Sahih (such as al-Albani).
Interpretation w.r.t Race:
White and black does not refer to the skin color or the race in this world. Rather this describes the appearance of the souls of the people in pre-existence.
A person's state in the pre-existence and afterlife is different from his or her state in this world. The skin color in this world does not not reflect the reward and status of a person in the afterlife, as we have several authentic ahadith which explicitly say that:
إن الله لا ينظر إلى صوركم وأموالكم ولكن ينظر إلى قلوبكم وأعمالكم
Verily Allah does not look to your faces and your wealth but He looks to your heart and to your deeds.
لا فضل لعربي على أعجمي ولا لعجمي على عربي ولا لأحمر على أسود ولا أسود على أحمر إلا بالتقوى
An Arab is no better than a non-Arab, and a non-Arab is no better than an Arab; a red man is no better than a black man and a black man is no better than a red man – except if it is in terms of taqwa (piety)
— Musnad Ahmad
Similarly we know of black skinned sahaba who were promised paradise, among them are Bilal (Bukhari 1149) and Umm Zafar (Bukhari 5652).