An important passage that gives a good summary of Whewell's view of scientific laws:
The Philosophy of the Inductive Sciences Founded Upon Their History By William Whewell
The idea, of course, is that general laws like Newton's laws of motion are simply general necessary principles insofar as they take form under certain possible conditions; thus they also need empirical support, in order to rule out other possible conditions. So, for instance, the first law is derived from the axiom that nothing can begin to exist without a cause, and therefore has a sort of derivative necessity to it, and can function as a sort of axiom on its own. But it's not necessary in itself; in order to apply the general causal principle to motion in particular, makes assumptions about motion that need to be confirmed against experience -- for instance, that time, and location, and the like don't in themselves function as causes of motion and rest. In other words, there's a sense in which the general form of the law is just a necessary causal principle, but in order to apply it to the particular field of motion we must go to experience to see what's relevant to a causal explanation of motion. This strikes a nice (and very deliberately intended) balance between granting the law a sort of fundamental and axiomatic character and allowing that it depends on hard-won empirical facts (and could potentially change if more precise accounting of those facts introduced qualifications).