I recommend you to take a look on this article - http://sujitpal.blogspot.ru/2011/05/custom-sorting-in-solr-using-external.html or sorting by FunctionQuery - http://wiki.apache.org/solr/FunctionQuery#Sort_By_Function
UPD. Also, one possible solution is add term query with boosting, e.g.
*:* OR type:A^100 OR type:B^200 OR type:C^2
So, it will be boosted in needed way. All you need to do, is play with boosting weight a little bit