Depending on your application scenario you don't need to write any barcode reading code. If user intervention is required for data introduction, the vast majority of current comercial barcode readers act as virtual keyboards that inject the read text (or code, or digits, or... etc.) as if it were just typed by one user (pulling the trigger is necessary in this case).
If you need to trigger the scanning from your program (something like a sensor that detects the marked object into the reading position, so you stop the conveyor and read the code), you'll also find readers supporting specific control APIs that can be controlled by serial or USB ports.
If you decide using artificial vision (cameras) for reading the barcode, wihch makes sense due to it's flexibility, you'll need to pay attention into how you control the illumination. We had lots of issues with it in the past when automating one machine (where one station was reading barcodes), even using 'good' industrial cameras. You can combine the OpenCV library for image capturing and pre-processing with the ZXing.Net library (mentioned in the previous solution).
For directly generating the content to print you could take a look a this article here:
Simple Receipt Like Printing Using the C# Printing API[
^].