You'll need to do two things for this to work:
- Build a contract reference assembly for the assembly that contains the interface.
- Consume that contract reference assembly when building the project containing the second class.
Both options can be controlled from the Code Contracts section in the properties pages of the respective projects in Visual Studio. (If you're using standard project references within a single solution, you probably won't have to do anything for #2 once you've fixed #1.)