The Hadeeth stating that who dies without allegiance to the Imam of his time, will die the death of Jahiliyyah (Ignorance) is a Mutawaatir Hadeeth which means narrated by many authentic narrators that can never jointly lie.
It has been narrated in many Sunni references like:
1. Musnad Ahmad Ibn Hanbal, V. 28, P. 88.
2. Saheeh Muslim, V. 3, P. 1478.
3. Hilyatul Awliyaa' by al-Asbahani, V.3, P. 244.
4. Kitab Al-Sunnah by Ibn Abi 'Aasim , V.2, P.503.
5. Al-Sunan Al-Khubra by al-Bayhaqi, V.8, P. 270.
6. Saheeh ibn Hibbaan, V.10, P.434.
7. Sunan Abi Dawood, V.3, P.425.
8. Al-Mo'jam Al-Kabeer by al-Tabaraani, V.19, P.334. And many other Sunni books.
Main Shia books as well narrated this Hadeeth like:
Kitab Al-Kaafi by al-Kulaini 2; 21,
Kamaal Al-Deen by Al-Sadouq;2;409,
and Kifayat Al-Athar by Al-Khazzaz 296.