How to inform your immediate boss about the offer
EarlyMy preference is to do this early in the day (when you or your boss arrives): let them know you need to speak to them. Do, and do so alone, preferably in their office. Inform
Inform your boss that you have received an offer from another company and intend to leave the companyterminate your employment (try to phrase it gently like you're letting a bad date down easy, if that makes any sense).
Let themyour boss know how long you are available to finish out any projects (2 weeks is relatively standard in the US, but if you are a major component of a team or a key member of the company a month is not out of line), and if you will be available for occasional phone calls after if an issue comes up.
If you are open to counter-offers let them know that as well.
Conclude
Conclude the meeting by handing them a written, signed, and dated letter of resignation stating when you will be terminating your employment. (It should go without saying, but it is somewhat uncouth to write this letter on your employer's time, or print it on the company printer.)
Should you try to negotiate about a matching offer?
This is a personal choice: Do you like your current company enough to stay?
From your question it sounds like you would prefer to work for the new company, so your decision is pretty well made here.
IMPORTANT NOTE
Be very careful when negotiating for a counter-offer. I have seen people given a counter-offer to keep them around just long enough for the company to find and train a replacement, at which point they are fired on the spot.
When negotiating a counter offer you are coming to your employer saying "I'm ready to walk out the door" - This is not likely to engender any loyalty on their part.
How do I inform the team - ASAP or ALAP?
Inform your team members / co-workers only AFTER you have formally tendered your resignation to your boss (and if you are entertaining counter offers, only after finally rejecting any counter-offer made).
I usually suggest letting your boss mention it at a status meeting or similar, and if you're working for a close-knit team you may want to tell the people who are taking over for you in a private meeting (you, them and your boss).
If the meetings thing is not your company culture you may want to tell your team members privately so they're not surprised when you don't show up one day.
Stuff you didn't mention: Managing the transition!
You're leaving the company. You won't be there when they have problems.
Unless you really hate this company, document the heck out of everything you do!
Make sure that all the obscure bits of knowledge that are only in your head are passed down to someone: Write down the combination to the donut safe, prepare your three envelopes, make sure someone knows to empty the bucket in the ceiling over the secretarial pool that catches water from the leaks when it rains, etc... -- I'm making light of this, but as a mark of professionalism this is critical. If you walk out and leave the company in the lurch your chances of a good reference from your boss/co-workers in the future is virtually nonexistent.