The one hardware project that it has done is the Xbox. The Xbox is now a solidly profitable division. However, it took time to get there. In this chart you can see the operating income for the Entertainment & Devices division at Microsoft where the Xbox group is based.
Overall, the Xbox group has lost $4 billion for Microsoft. However, since 2007 it has made $1 billion. (Note, this chart doesn't include 2002-2004 when it piled up losses getting the business off the ground.)
Hopefully, Microsoft can take the lessons it learned on the Xbox in the last five years and apply them to the Surface.