Amicus briefs are generally only done in appeal cases. This is because appeals courts make law, where lower courts simply resolve disputes between parties. Where a case is on appeal and there is the potential to make and/or change law, then various interest groups want to throw in their best effort to brief the case fully so that the court has their take on the issue.
This answer is provided for informational purposes only. Actual legal advice can only be provided in an office consultation by an attorney licensed in your jurisdiction, with experience in the area of law in which your concern lies.
There is much discussion of amici curiae and their relationship to the proceedings, and their liability for attorney's fees, in Connerly v. State Personnel Bd., 37 Cal.4th 1169, 129 P.3d 1 (2006). In District Court, non-parties must receive leave to file briefs. See United States v. City of Los Angeles, 288 F.3d 391, 400 (9th Cir. 2002). Amicus briefs can be filed, under appropriate circumstances and with leave of court, at the trial court level, but it is somewhat rare until it gets to the appellate level.