The Rig Vedic Purusha Sukta mentions Rajanya, Brahmin, Vaishya and Sudra, but doesn't call them Varnas. Which scripture first uses the word varna for the classification-scheme?
For the first genuine use of varna to mean caste, we must go to the Bhagavad Gita, considered to have been written around/before the start of the Common Era, perhaps around 400 BCE:
चातुर्-वर्ण्यं मया सृष्टं गुण-कर्म-विभागशः । तस्य कर्तारम् अपि मां विद्ध्य् अकर्तारम् अव्ययम् ॥ १३ ॥
cātur-varṇyaṃ mayā sṛṣṭaṃ guṇa-karma-vibhāgaśaḥ | tasya kartāram api māṃ viddhy akartāram avyayam ||
[cātur-varṇyam refers to the system of the four social orders]
The fourfold system of varṇas (brāhmaṇa, kṣatriya, vaiśya and śūdra) was created by Me according to divisions of quality (guṇa) and work (karma). Although I am the creator of this system, you should know that I am the immutable non-doer.
Varna implying caste appears only once in the Rig Veda, and this takes a bit of a liberal interpretation. Sāyaṇa, in his commentary on the text, took this interpretation. It can't really be considered the first example, since it merely shows the word's early use; it merely implies the idea of caste, not necessarily meaning it completely.
ससानात्याँ उत सूर्यं ससानेन्द्रः ससान पुरुभोजसं गाम् ।
हिरण्ययमुत भोगं ससान हत्वी दस्यून्प्रार्यं वर्णमावत् ॥
sasānātyām̐ uta sūryaṃ sasānendraḥ sasāna purubhojasaṃ gām
“He gave horses, he gave also the sun, and Indra gave also the many-nourishing cow; he gave golden treasure, and having destroyed the dasyus, he protected the ārya tribe.”
Commentary by Sāyaṇa: Ṛgveda-bhāṣya: The ārya tribe: ārya varṇam = implies only the best tribe, or order, uttamam varṇam, or the three first castes collectively