Just make a variable for example bullet and it has to be of type transform and then use this code inside your function. You also have to make a spawnpoint, were you want the bullet to appear.
var bulletPrefab : Transform;
var bullet = Instantiate(bulletPrefab,transform.Find("SpawnPointCannon").transform.position, Quaternion.identity);
// this applies a force to your bullet
bullet.rigidbody.AddForce(transform.forward * 1000);
Jun 01 '11 at 05:43 PM