The first thing that you need to do is add a category column to your eCart object. And then update your add to cart server behavior to bind the category id to your category column.
Then open your eCart object, and click on shipping tab and click the add button. Under Triggers click the add button and for the condition select "Number of items with a specific column value" and select category for your column drop down list, and then from the calculation drop down list you can either set a flat rate or use the USPS shipping rate.
You will need to add this for each category that you want to set the shipping for. And then you will need to add a shipping rule for all other cases.