I finally found where the Sama Veda quote is from. Here is the Sama Veda in Sanskrit. Near the beginning of the Aranya Archikah, Aranya Kandam section, the following verse occurs:
ahamasmi prathamajā ṛtasya pūrvaṃ devebhyo amṛtasya nāma |
yo mā dadāti sa idevamāvadahamannamannamadantamadmi || 594
Here is how this webpage translates the verse
I have been created before the creation of devtas and nobody can survive without consuming me. Those who donate me in Yagna etc., I protect them and bestow them with the result of pious deeds [punya].
Apparently this verse was turned into a Sama Veda song called Svargyam Sethushama, AKA Purushagati. You can listen to the song here; I highly recommend it if you haven't heard Sama Veda singing before.
The preamble to the hymn provides useful information about the verse:
Svargyam Sethushama Purushagathirva Prajapati Rishihi Trishtup Chandaha Atma Devata
Of [the hymn called] Svargyam Sethushama [or] Purushagathi, the sage [who heard it from the gods] is Prajapati, the meter is Trishtup, the deity [whom it's addressed to] is Atma.
So I assume that the mantra was first heard by Brahma (Prajapati), and that it was said in praise of Vishnu (Paramatma), based on the information in my question about its use in Vaikuntha.