Listen to the bass lines in hip-hop songs and notice that the best bass lines are simple and emphasize the low end. Notice that the bass works in tandem with the kick drum and fills in the space between the back beat. Emulate preexisting bass lines to get the feel for the bass line's role in hip-hop.
Record your bass line. You can use an electric bass or MIDI (if you use MIDI, search for a good synth) and then tweak the sound with a recording program (Pro Tools and Reason are two popular programs). To attain a good hip-hop sound, apply a low pass filter or over-compression to the bass channel. Applying these effects will isolate the bass sound and keep it from interfering with the vocals.
Loop your bass line with the drum patterns to make sure that they work well together. A good bass line can sometimes be overshadowed by a drum pattern that is too busy or loud. Conversely, make sure that your bass line does not drown out the drum pattern.