In the UK it's the Auto-Cycling Union or ACU who handles the licences, as a n00b you'll get a Rookie licence and then go up to Clubman, National and International depending on results.
To get the licence isn't hugely expensive, you'll need to join a club and apply for the licence at around £85 ish nowadays I think.
For clubs I've only used BMCRC, the British Motor Cycle Racing Club, or Bemsee for short.
http://www.bemsee.net
You'll need to go through a the 'CTC', Bemsee do this mainly as a weekend in late February, one day will be basically a 'lesson and then doing a multiple choice 'test' which is trivial. The second day is a day on-track with an instructor and a couple of other rookies, you'll go through noise test, scrutineering etc and as long as you're not either ridiculously slow or plain dangerous you'll 'pass' and the club will send your documents to the ACU for the licence.
As for racing itself, you need to pick a class (I did the Formula 400's), and then pay lots of money to go race for a weekend, simple
Most clubs either require you to pay an annual membership (which you'll need with one club to get the licence in the first place as mentioned), but will offer something like a weekend membership for ~£10.
The weekend sometimes has a test day, this is a trackday on steroids for ~£120-150. Then the race weekend itself is around £240+ from Bemsee, that's for 2 days, 1 qualifying, 4 races and usually a warmup on the Sunday.
Then obviously tyres/fuel/damage (you *will* crash

) and it adds up, probably want to budget around £5-600 for a weekend, more for the bigger classes where you'll be using far more tyres.