so you wrote your bassline, added a synth, sylenth or massive or whatever,
you need a sub underneath all that so it sounds nice and good for the ears, basically you just need to duplicate the same notes to your sub channel, you need to eq it with a high cut at around 300hz i think, you must have compression and sidechaining
this is the most basic technique, there are more advanced techniques where you can start mixing things up with the notes...with amazing effect, i've heard it a lot in the electro house stuff..
if you are adding sub for your leads, you can put the sub bass notes at the 2nd lowest note of your leads,
say your leads start at G1, then layered into G2, then put the sub bass notes on your G2