There is a step-by-step guide on setting up WarCraft II on Adam Pierce's blog.
Essentially, it runs great under DosBox, all you need to do is run WarCraft's SETUP.EXE and select Soundblaster 16 as the sound card. Leave all other options at their default settings.
You also need to mount the CD drive because Warcraft II will not start unless it detects the original CD in the drive. Here's the command to do that:
MOUNT D D:\ -T CDROM
You might also like to reduce the cycles to 20000 or so in dosbox.conf to stop it scrolling too fast.