I have a device that when a particular application is on send data to that application. I need to cheat this data and retrieve certain information that is not displayed. The device is custom and for some reason has no data sheets. So have to sniff the communication and rebuild the commands sent from the application to this device. So I would like to achieve this in C# or C++. Right now I've tried every sniffing software and yes they sniff it, but I want to be able to know and retrieve the data and present it live.
The easiest way to do this is to put your software between the device and the other software. Next, review all the data and capture what you need.
To do this, use serial port loopback software. There's a lot of it out there. See http://virtual-serial-port.org.
A more complicated (but more passive!) Method is to monitor IOCTLs. I can't guide you how to do things that I don't know, but that's something to look at. The software at https://www.com-port-monitoring.com/ uses this method.
An alternative piece of software that gives you virtual serial ports is com0com (http://com0com.sourceforge.net/). However, it also has a hub functionality where the device output can be sent to many applications, which may or may not be useful to you, depending on whether you just need to monitor the output from the device or in both directions.
If nothing else it can give you some open source code to base your own sniffer on if you go down the device filter route. But if you go down this route, you may need to look at the driver's signature if you need it to work on 64-bit versions of Windows 10.