So I would like to make a heartbeat sensor. This is easy in android as it has the camera and the flash LED but would be impossible to make in PC without the right software... Unless i would use the sensor that the optical mouse uses to capture the laser. At this point i am not asking if this would be accurate or something like that i am just interested in knowing, how does one access the sensor information?
The mouse is installed to your computer as a human interface device (USB device type HID), so you do not have direct access to the sensor data via the usual means. Unless the mouse supports some other mode you would have to access the information directly from the hardware of the mouse, which is beyond the scope of your question
A mouse generally doesn't provide direct access to the sensor(s).
Consider using a PC webcam instead. After all, it is the camera sensor on the phone (with light from the LED) which detects the heart rate.
A python application that detects and highlights the heart-rate of an individual (using only their own webcam) in real-time.