You need to just recalculate your normal way of strength based attacks, replace the old strength bonus with a new one and use your own base attack bonus. You shouldn't use any natural attacks or other statistics from animal companions as they are balanced towards being animal companions, are usually smaller in size and have other modified statistics. Rule of thumb is to use the monster entry for wild shape.
Here is the calculation:
You are a 8th level druid so your base attack bonus is +6 with and 'iterative' attack at +1 BAB (Summarized +6/+1).
your normal strength is 18 so that is a +4.
= +10/+5 total to hit in human form, using damage from a relevant weapon (ie. quarterstaff would do 1d6+4 (strength)).
While you become a stegosaurus:
you use your base attack bonus of +6
and your Strength, modified as though you used Beast Shape III (6 more Strength in Huge form, for 24 total), which makes it a total bonus of +7
= to hit modifier is now +13
(this is further improved with feats and magic items that have indefinite bonuses, if any)
Your damage is not too tricky either, just use the base damage of stegosaurus' tail natural attack 4d6, and add 1.5 times the strength bonus (always round down fractions). 7 * 1.5 = 10.5, which becomes a total of +10 damage bonus.
so the total damage you would do on a hit is:
You would only do this attack once because natural attacks do not gain iterative attacks from BAB of 6 or more.
after the attack you can try the trip maneuver with your modified CMB 6(BAB)+7(Strength)+2(Huge Size) for a total of +15 to Trip, unless you possess feats (improved trip, greater trip, etc.) that boost your bonus with it.
sidenote: you also gain low-light vision, scent and the reach of the creature.
Natural attack tail: +13 to hit, 4d6+10 damage.