(win32) Fix for compiling with msvc

  * Fix for no stdint.h support before msvc 10.
  * Fix some syntax errors and logic errors to get codes work with msvc.
  * Kill all warnings of compiling with msvc.
(win32) Fix reportSize() and reportCount() of value_type
(win32) Fix for stringFromTCHAR

Fix the wrong characters count of TCHAR string, that produce unnecessary characters at the end of result, might result in wrong result of comparing std::string(s).
(win32) Fix for reparent of elements

The top-level collections were divided into different physical device object (PDO) in Windows (see: http://msdn.microsoft.com/en-us/library/windows/hardware/ff543475(v=vs.85).aspx).
Therefore, there is only one top-level collection, others are sub-collections (see: http://msdn.microsoft.com/en-us/library/windows/hardware/ff542355(v=vs.85).aspx#ddk_link_collection_array_kg).
(win32) Fix for referring invalid iterator
(win32) Fix for endless loop in device_type::read()

The device_type::read() would not return while there is no any input, even the device was been closed. It's necessary to add an invalid handle checking before invoking ReadFile to prevent an endless loop.
(win32) Fix for the wrong usage range expanding

An usage range is specified by usage minimum and usage maximum items in report descriptor, this range is start from usage minimum and end with usage maximum, but includes usage minimum and usage maximum as well.
(win32) Fix for device::write

Should use overload style WriteFile, and use bufferOutputReport() instead of bufferInputReport()
Add CMakeLists.txt