Three options:
1) A USB-barcode scanner will have keyboard emulation. Meaning, a scanned barcode will appear at your current input cursor as if you've typed the number/string manually into a keyboard. So you could just have a text input control and just don't bother if it's a keyboard or barcode scanner where the input comes from. Advantage: Easiest to set up. Disadvantage: You have to take care that the text input control always has the input focus when the user might want to scan a barcode.
2) The manufacturer of your barcode scanner MIGHT have an API for it. For low budget scanners there are most often none. Advantage: No trouble with an input control. Disadvantage: You're limiting your application to one type of barcode scanner. More work than for 1)
3) Use the Windows "Raw Input API". Explained and demonstrated in this CodeProject article:
Using Raw Input from C# to handle multiple keyboards[
^]
Advantage: No trouble with an input control. No trouble with vendor specific API's. Disadvantage: More work than for 1)