First, in Bluestacks, go to Settings -> Preferences -> Enable Android Debug Bridge (ADB). Like this:

At this point, Bluestacks enables its adb functionality and exposes itself to the localhost at port 5555 (the default port)
So, in your command line, type adb connect localhost:5555 and you should be good to go.