How to create a distance matrix using the HC-SR04 sensor?

Please share. Also please let me know if any library to send the data over serial port to a Windows cosole application?