This is something we've struggled with. The final phase of our interviewing process is a few hours of pair programming. If folks worked on production code, we wanted to pay them.
Paying people for a few hours of work is difficult: if we pay them as an employee then we have to do employee paperwork and deal with the payroll company. If we pay them as a contractor then they have to sign a lot of contractor paperwork, including a confidentiality and intellectual property assignment agreement. It's the kind of thing I wouldn't sign without my lawyer's advice. It just seems like too much trouble.
Instead, we'll either work on a throwaway toy project or an open-source project. Both of those are working well so far, and people seem happy to actually ship some open-source code at the end of the interview.