What to expect? Typically you'll have weekly meetings with the drug court specialists, random urine screens, requirements to attend X number of AA/NA meetings per week, (possibly) some community service and (possibly) some fines. You'll likely also be made to undergo an assessment to see what type of accompanying treatment you need - from counseling to outpatient to inpatient. As well, you might be put on a parallel probation, which, though they'll never admit it, is simply to milk you for a little more money.
You'll have just enough freedom that you could use during this all and not get caught if you do it correct, but you really do not want to do this. Drug courts usually reward graduates with dropped charges or even expungement, but if you screw up they will probably come down hard on ya. Suck it up and accept the fact that you lost and they won, and that your best interests are to get clean. At least for the duration of the drug court. This will be difficult at first, but more likely than not it will be satisfying all of the conditions of the drug court/probation while trying to maintain a job to pay off all of the expenses that will really test your patience. If you throw drugs into the equation, you'll never be able to get everything done correctly while maintaining the lifestyle is being a heroin user. Hence you should not use, and really it's like the drug court is giving you just enough freedom over your use to see if you make the right choices or not.
Check to see if your drug court allows for methadone and/or Suboxone if you need help quitting. Typically the drug courts will give you the help you need in the beginning to find a way to quit.