Affiliation for a student's internship project
A paper that I have recently read may be a good reference (or example). As can be seen, one of the co-authors, Xuemei Liu is under Baidu, Inc. Shanghai. The research work was done when she (gender inferred from the name) was done during her internship at HP Lab.

She wrote the affiliation as Baidu, and used a star mark as the footnote indicating the work was carried out during her HP Lab internship period.



Update: Another more relevant example:

This paper here is exactly the case. The first author is a student under Shanghai Jiaotong University (student and thus, unpaid). The work of the paper was performed when he was an internship under Microsoft Research Asia. They adopted the same way: affiliation is still the university and a star footnote indicates the internship connection.